#pragma once
#include "tlv_types.h"

class TLVBuffer {
public:
    explicit TLVBuffer(size_t capacity);
    ~TLVBuffer();

    bool writeRaw(TLVType type, const void* data, uint16_t length);
    bool readTLV(size_t offset, TLV& out)const;

    const uint8_t* data() const;
    size_t size() const;

private:
    std::vector<uint8_t> buffer_;
    size_t writePos_;
};
